<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Initialization Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ctb__functions__init.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Initialization Functions<div class="ingroups"><a class="el" href="group__group__ctb.html">CTB          (Continuous Time Block)</a> &raquo; <a class="el" href="group__group__ctb__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions are for initializing, enabling, and disabling the CTB. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga11187bf8d766321decd675d3f666adb1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__init.html#ga11187bf8d766321decd675d3f666adb1">Cy_CTB_Init</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, const <a class="el" href="structcy__stc__ctb__config__t.html">cy_stc_ctb_config_t</a> *config)</td></tr>
<tr class="memdesc:ga11187bf8d766321decd675d3f666adb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize or restore the CTB and both opamps according to the provided settings.  <a href="#ga11187bf8d766321decd675d3f666adb1">More...</a><br /></td></tr>
<tr class="separator:ga11187bf8d766321decd675d3f666adb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafa352730de040364974dc22bd3cec27f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__init.html#gafa352730de040364974dc22bd3cec27f">Cy_CTB_OpampInit</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> opampNum, const <a class="el" href="structcy__stc__ctb__opamp__config__t.html">cy_stc_ctb_opamp_config_t</a> *config)</td></tr>
<tr class="memdesc:gafa352730de040364974dc22bd3cec27f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize each opamp separately without impacting analog routing.  <a href="#gafa352730de040364974dc22bd3cec27f">More...</a><br /></td></tr>
<tr class="separator:gafa352730de040364974dc22bd3cec27f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga883b9f798a3e8ea627c87f1a0bbf90ba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__init.html#ga883b9f798a3e8ea627c87f1a0bbf90ba">Cy_CTB_DeInit</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, bool deInitRouting)</td></tr>
<tr class="memdesc:ga883b9f798a3e8ea627c87f1a0bbf90ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset CTB registers back to power on reset defaults.  <a href="#ga883b9f798a3e8ea627c87f1a0bbf90ba">More...</a><br /></td></tr>
<tr class="separator:ga883b9f798a3e8ea627c87f1a0bbf90ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7bdb789cecd993b6871bc3e31a239473"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__init.html#ga7bdb789cecd993b6871bc3e31a239473">Cy_CTB_FastInit</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, const <a class="el" href="structcy__stc__ctb__fast__config__oa0__t.html">cy_stc_ctb_fast_config_oa0_t</a> *config0, const <a class="el" href="structcy__stc__ctb__fast__config__oa1__t.html">cy_stc_ctb_fast_config_oa1_t</a> *config1)</td></tr>
<tr class="memdesc:ga7bdb789cecd993b6871bc3e31a239473"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize each opamp of the CTB to one of the common use modes.  <a href="#ga7bdb789cecd993b6871bc3e31a239473">More...</a><br /></td></tr>
<tr class="separator:ga7bdb789cecd993b6871bc3e31a239473"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga867711bf1d5e8216b7bacdf0975fd712"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__init.html#ga867711bf1d5e8216b7bacdf0975fd712">Cy_CTB_Enable</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base)</td></tr>
<tr class="memdesc:ga867711bf1d5e8216b7bacdf0975fd712"><td class="mdescLeft">&#160;</td><td class="mdescRight">Power up the CTB hardware block.  <a href="#ga867711bf1d5e8216b7bacdf0975fd712">More...</a><br /></td></tr>
<tr class="separator:ga867711bf1d5e8216b7bacdf0975fd712"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d5c69edc7415f7390036a3a8305f8c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__init.html#ga3d5c69edc7415f7390036a3a8305f8c2">Cy_CTB_Disable</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base)</td></tr>
<tr class="memdesc:ga3d5c69edc7415f7390036a3a8305f8c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Power down the CTB hardware block.  <a href="#ga3d5c69edc7415f7390036a3a8305f8c2">More...</a><br /></td></tr>
<tr class="separator:ga3d5c69edc7415f7390036a3a8305f8c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga11187bf8d766321decd675d3f666adb1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga11187bf8d766321decd675d3f666adb1">&#9670;&nbsp;</a></span>Cy_CTB_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> Cy_CTB_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__ctb__config__t.html">cy_stc_ctb_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize or restore the CTB and both opamps according to the provided settings. </p>
<p>Parameters are usually set only once, at initialization.</p>
<dl class="section note"><dt>Note</dt><dd>This function call disables a whole CTB block, call <a class="el" href="group__group__ctb__functions__init.html#ga867711bf1d5e8216b7bacdf0975fd712">Cy_CTB_Enable</a> after this function call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">config</td><td>Pointer to structure containing configuration data for entire CTB</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of initialization, <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> or <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0da5e724967a6716dc6015415c942370cc5">CY_CTB_BAD_PARAM</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<p>The following code snippet configures Opamp0 as a comparator and Opamp1 as an opamp follower with 10x drive. The terminals are routed to external pins by closing the switches shown.</p>
<div class="image">
<img src="ctb_init_funcusage.png" alt="ctb_init_funcusage.png"/>
</div>
 <div class="fragment"><div class="line">    <span class="comment">/* Scenario: Configure Opamp0 and Opamp1 as follows:</span></div><div class="line"><span class="comment">     * Opamp0:</span></div><div class="line"><span class="comment">     *  - Mode: Comparator</span></div><div class="line"><span class="comment">     *  - Inverting input: P9.1</span></div><div class="line"><span class="comment">     *  - Non-inverting input: P9.0</span></div><div class="line"><span class="comment">     *  - Comparator output: P9.2 through HSIOM switches</span></div><div class="line"><span class="comment">     * Opamp1:</span></div><div class="line"><span class="comment">     *  - Mode: Opamp follower with 10x drive</span></div><div class="line"><span class="comment">     *  - Non-inverting input: P9.5</span></div><div class="line"><span class="comment">     *  - Output: P9.3</span></div><div class="line"><span class="comment">     *</span></div><div class="line"><span class="comment">     * Note: The CTB dedicated port may vary depending on the device.</span></div><div class="line"><span class="comment">     */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Configure and enable the charge pump clock and analog reference currents</span></div><div class="line"><span class="comment">     * before using the CTB. See Configuration Dependencies section in the driver overview for more information. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> status;</div><div class="line">    </div><div class="line">    <span class="comment">/* Define initialization structure. */</span></div><div class="line">    <span class="keyword">const</span> <a class="code" href="structcy__stc__ctb__config__t.html">cy_stc_ctb_config_t</a> config = </div><div class="line">    {</div><div class="line">        <span class="comment">/* .deepSleep          = */</span> <a class="code" href="group__group__ctb__enums.html#ggae394b9178fb8507bdc58838cb0bcadc9a5191cfd1c0e9412bc23ad6e38c69057c">CY_CTB_DEEPSLEEP_DISABLE</a>,</div><div class="line">        </div><div class="line">        <span class="comment">/* Opamp0 configuration */</span></div><div class="line">        <span class="comment">/* .oa0Power           = */</span> <a class="code" href="group__group__ctb__enums.html#gga9cbeea246fe4162a2d4d7be689e807c7aae2c9f6a316b91068303ed99830455b0">CY_CTB_POWER_MEDIUM</a>,</div><div class="line">        <span class="comment">/* .oa0Mode            = */</span> <a class="code" href="group__group__ctb__enums.html#ggad4b99429b5ed1561e1b82bb7a21d9e79a020b57053d5eddc8b6bdb6e24ac100f7">CY_CTB_MODE_COMP</a>,                   <span class="comment">/* Configure as a comparator. */</span></div><div class="line">        <span class="comment">/* .oa0Pump            = */</span> <a class="code" href="group__group__ctb__enums.html#gga8517634c935bde4de8ccce97aa1e21f4ab9ecbb1c3a529cdeb938ecc3dc6add6f">CY_CTB_PUMP_ENABLE</a>,</div><div class="line">        <span class="comment">/* .oa0CompEdge        = */</span> <a class="code" href="group__group__ctb__enums.html#gga6ae45a6e79c46d06120295f542981cf4af356e98625d625f0ed35260a11dc6647">CY_CTB_COMP_EDGE_BOTH</a>,              <span class="comment">/* Both edges of the comparator will trigger an interrupt. */</span></div><div class="line">        <span class="comment">/* .oa0CompLevel       = */</span> <a class="code" href="group__group__ctb__enums.html#gga1d4c88f3c58f2cba9122932a65721f9eaa4b8129109df9d5d1ec3d7253baf7fe2">CY_CTB_COMP_DSI_TRIGGER_OUT_LEVEL</a>,  <span class="comment">/* Comparator digital output is synchronized to comparator status. */</span></div><div class="line">        <span class="comment">/* .oa0CompBypass      = */</span> <a class="code" href="group__group__ctb__enums.html#ggab99b3f65e01d39c47bb49b1255f478d2a355e7f8cb9d5ba71b9cd5cfa37e293b5">CY_CTB_COMP_BYPASS_SYNC</a>,</div><div class="line">        <span class="comment">/* .oa0CompHyst        = */</span> <a class="code" href="group__group__ctb__enums.html#ggad36a97756b1a5ea884c9a6653c0a26c7a5fcfb393b5ff8d864116f914c5147c06">CY_CTB_COMP_HYST_10MV</a>,              <span class="comment">/* Enable 10 mV hysteresis. */</span></div><div class="line">        <span class="comment">/* .oa0CompIntrEn      = */</span> <span class="keyword">true</span>,                               <span class="comment">/* Enable interrupt. */</span></div><div class="line">        </div><div class="line">        <span class="comment">/* Opamp1 configuration */</span></div><div class="line">        <span class="comment">/* .oa1Power           = */</span> <a class="code" href="group__group__ctb__enums.html#gga9cbeea246fe4162a2d4d7be689e807c7aae2c9f6a316b91068303ed99830455b0">CY_CTB_POWER_MEDIUM</a>,</div><div class="line">        <span class="comment">/* .oa1Mode            = */</span> <a class="code" href="group__group__ctb__enums.html#ggad4b99429b5ed1561e1b82bb7a21d9e79a156558bf7b355f984d233170ca06b75f">CY_CTB_MODE_OPAMP10X</a>,               <span class="comment">/* Configure as an opamp with 10x drive. */</span></div><div class="line">        <span class="comment">/* .oa1Pump            = */</span> <a class="code" href="group__group__ctb__enums.html#gga8517634c935bde4de8ccce97aa1e21f4ab9ecbb1c3a529cdeb938ecc3dc6add6f">CY_CTB_PUMP_ENABLE</a>,</div><div class="line">        <span class="comment">/* .oaCompEdge         = */</span> <a class="code" href="group__group__ctb__enums.html#gga6ae45a6e79c46d06120295f542981cf4a98c8ed8c5a8046b770b4e9b04242c0bb">CY_CTB_COMP_EDGE_DISABLE</a>,           <span class="comment">/* Ignore comparator settings. */</span></div><div class="line">        <span class="comment">/* .oaCompLevel        = */</span> <a class="code" href="group__group__ctb__enums.html#gga1d4c88f3c58f2cba9122932a65721f9eaa4b8129109df9d5d1ec3d7253baf7fe2">CY_CTB_COMP_DSI_TRIGGER_OUT_LEVEL</a>,</div><div class="line">        <span class="comment">/* .oaCompBypass       = */</span> <a class="code" href="group__group__ctb__enums.html#ggab99b3f65e01d39c47bb49b1255f478d2a355e7f8cb9d5ba71b9cd5cfa37e293b5">CY_CTB_COMP_BYPASS_SYNC</a>,</div><div class="line">        <span class="comment">/* .oaCompHyst         = */</span> <a class="code" href="group__group__ctb__enums.html#ggad36a97756b1a5ea884c9a6653c0a26c7a16c2bec1cbcd96230fb824f04648b4c6">CY_CTB_COMP_HYST_DISABLE</a>,</div><div class="line">        <span class="comment">/* .oa10CompIntrEn     = */</span> <span class="keyword">false</span>,</div><div class="line">        </div><div class="line">        <span class="comment">/* .configRouting      = */</span> <span class="keyword">true</span>,</div><div class="line">        <span class="comment">/* .oa0SwitchCtrl      = */</span> (uint32_t) (<a class="code" href="group__group__ctb__enums.html#gga489ce541855b5cc316c20a7f801b068caf66ad18756866b4ee3f3cd2da7b0fcc0">CY_CTB_SW_OA0_POS_PIN0_MASK</a> | <a class="code" href="group__group__ctb__enums.html#gga489ce541855b5cc316c20a7f801b068ca44bd09da7a365d775cfc1e4dc25b214c">CY_CTB_SW_OA0_NEG_PIN1_MASK</a>), <span class="comment">/* Close switches A20 and A11. */</span></div><div class="line">        <span class="comment">/* .oa1SwitchCtrl      = */</span> (uint32_t) (<a class="code" href="group__group__ctb__enums.html#gga2d6abb7e9f8fb4e7c41bf1480d829eebae1dc2638caf2ff2b7841c2e798c9b880">CY_CTB_SW_OA1_NEG_OUT_MASK</a> | <a class="code" href="group__group__ctb__enums.html#gga2d6abb7e9f8fb4e7c41bf1480d829eebacc6a1f492795a334b048c214d1c9ce04">CY_CTB_SW_OA1_OUT_SHORT_1X_10X_MASK</a> | <a class="code" href="group__group__ctb__enums.html#gga2d6abb7e9f8fb4e7c41bf1480d829eeba2aba3d6ffee44cb6e571107126131900">CY_CTB_SW_OA1_POS_PIN5_MASK</a>), <span class="comment">/* Close switches A13, A82, and D82. */</span></div><div class="line">        <span class="comment">/* .ctdSwitchCtrl      = */</span> (uint32_t) <a class="code" href="group__group__ctb__enums.html#ggaf0495f79031c0cac37acdb7830cb0149aff93f7d60121d0d0f05f6ed9d043c878">CY_CTB_SW_CTD_CHOLD_OA0_POS_ISOLATE_MASK</a>, <span class="comment">/* Close switch CIS. */</span></div><div class="line">    };</div><div class="line">    </div><div class="line">    status = <a class="code" href="group__group__ctb__functions__init.html#ga11187bf8d766321decd675d3f666adb1">Cy_CTB_Init</a>(CTBM0, &amp;config);</div><div class="line">    </div><div class="line">    <span class="comment">/* Route comparator 0 digital output to P9.2 using HSIOM. */</span></div><div class="line">    <a class="code" href="group__group__gpio__functions__init.html#gaf57c501727276013d3e8974a9fb7d0a7">Cy_GPIO_Pin_FastInit</a>(GPIO_PRT9, 2UL, <a class="code" href="group__group__gpio__drive_modes.html#gacebd8bea6222d742bdfbfd86dabab940">CY_GPIO_DM_STRONG_IN_OFF</a>, 0UL, P9_2_PASS_DSI_CTB_CMP0);</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> == status){</div><div class="line">        <a class="code" href="group__group__ctb__functions__init.html#ga867711bf1d5e8216b7bacdf0975fd712">Cy_CTB_Enable</a>(CTBM0);</div><div class="line">    }</div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
<a id="gafa352730de040364974dc22bd3cec27f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafa352730de040364974dc22bd3cec27f">&#9670;&nbsp;</a></span>Cy_CTB_OpampInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> Cy_CTB_OpampInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>opampNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__ctb__opamp__config__t.html">cy_stc_ctb_opamp_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize each opamp separately without impacting analog routing. </p>
<p>Intended for use by automatic analog routing and configuration tools to configure each opamp without having to integrate the settings with those of the other opamp first.</p>
<p>Can also be used to configure both opamps to have the same settings.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">opampNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a>, or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a4c859afffdcf6dcf16c4350906759488">CY_CTB_OPAMP_BOTH</a></td></tr>
    <tr><td class="paramname">config</td><td>Pointer to structure containing configuration data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of initialization, <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> or <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0da5e724967a6716dc6015415c942370cc5">CY_CTB_BAD_PARAM</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Configure Opamp0 as a comparator without touching Opamp1 or any routing. */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Configure and enable the charge pump clock and analog reference currents</span></div><div class="line"><span class="comment">     * before using the CTB. See Configuration Dependencies section in the driver overview for more information. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> opamp0Status;</div><div class="line">    </div><div class="line">    <span class="comment">/* Initialization structure for Opamp0. */</span></div><div class="line">    <span class="keyword">const</span> <a class="code" href="structcy__stc__ctb__opamp__config__t.html">cy_stc_ctb_opamp_config_t</a> opamp0Config = </div><div class="line">    {</div><div class="line">        <span class="comment">/* .deepSleep         = */</span> <a class="code" href="group__group__ctb__enums.html#ggae394b9178fb8507bdc58838cb0bcadc9a5191cfd1c0e9412bc23ad6e38c69057c">CY_CTB_DEEPSLEEP_DISABLE</a>,</div><div class="line">        <span class="comment">/* .oaPower           = */</span> <a class="code" href="group__group__ctb__enums.html#gga9cbeea246fe4162a2d4d7be689e807c7aae2c9f6a316b91068303ed99830455b0">CY_CTB_POWER_MEDIUM</a>,</div><div class="line">        <span class="comment">/* .oaMode            = */</span> <a class="code" href="group__group__ctb__enums.html#ggad4b99429b5ed1561e1b82bb7a21d9e79a020b57053d5eddc8b6bdb6e24ac100f7">CY_CTB_MODE_COMP</a>,                    <span class="comment">/* Configure as a comparator. */</span></div><div class="line">        <span class="comment">/* .oaPump            = */</span> <a class="code" href="group__group__ctb__enums.html#gga8517634c935bde4de8ccce97aa1e21f4ab9ecbb1c3a529cdeb938ecc3dc6add6f">CY_CTB_PUMP_ENABLE</a>,</div><div class="line">        <span class="comment">/* .oaCompEdge        = */</span> <a class="code" href="group__group__ctb__enums.html#gga6ae45a6e79c46d06120295f542981cf4af356e98625d625f0ed35260a11dc6647">CY_CTB_COMP_EDGE_BOTH</a>,               <span class="comment">/* Both edges of the comparator will trigger an interrupt. */</span></div><div class="line">        <span class="comment">/* .oaCompLevel       = */</span> <a class="code" href="group__group__ctb__enums.html#gga1d4c88f3c58f2cba9122932a65721f9eaa4b8129109df9d5d1ec3d7253baf7fe2">CY_CTB_COMP_DSI_TRIGGER_OUT_LEVEL</a>,   <span class="comment">/* Comparator digital output is synchronized to comparator status. */</span></div><div class="line">        <span class="comment">/* .oaCompBypass      = */</span> <a class="code" href="group__group__ctb__enums.html#ggab99b3f65e01d39c47bb49b1255f478d2a355e7f8cb9d5ba71b9cd5cfa37e293b5">CY_CTB_COMP_BYPASS_SYNC</a>,</div><div class="line">        <span class="comment">/* .oaCompHyst        = */</span> <a class="code" href="group__group__ctb__enums.html#ggad36a97756b1a5ea884c9a6653c0a26c7a5fcfb393b5ff8d864116f914c5147c06">CY_CTB_COMP_HYST_10MV</a>,               <span class="comment">/* Enable 10 mV hysteresis. */</span></div><div class="line">        <span class="comment">/* .oaCompIntrEn      = */</span> <span class="keyword">true</span>,                                <span class="comment">/* Enable interrupt. */</span></div><div class="line">    };</div><div class="line">    </div><div class="line">    opamp0Status = <a class="code" href="group__group__ctb__functions__init.html#gafa352730de040364974dc22bd3cec27f">Cy_CTB_OpampInit</a>(CTBM0, <a class="code" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, &amp;opamp0Config);</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> == opamp0Status){</div><div class="line">        <span class="comment">/* Turn on the CTB block. */</span></div><div class="line">        <a class="code" href="group__group__ctb__functions__init.html#ga867711bf1d5e8216b7bacdf0975fd712">Cy_CTB_Enable</a>(CTBM0);</div><div class="line">        </div><div class="line">        <span class="comment">/* Call Cy_CTB_SetAnalogSwitch function to configure routing if desired. */</span></div><div class="line">    }</div></div><!-- fragment -->
</div>
</div>
<a id="ga883b9f798a3e8ea627c87f1a0bbf90ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga883b9f798a3e8ea627c87f1a0bbf90ba">&#9670;&nbsp;</a></span>Cy_CTB_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> Cy_CTB_DeInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>deInitRouting</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset CTB registers back to power on reset defaults. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">deInitRouting</td><td>If true, all analog routing switches are reset to their default state. If false, analog switch registers are untouched.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of initialization, <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> or <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0da5e724967a6716dc6015415c942370cc5">CY_CTB_BAD_PARAM</a> </dd></dl>

</div>
</div>
<a id="ga7bdb789cecd993b6871bc3e31a239473"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7bdb789cecd993b6871bc3e31a239473">&#9670;&nbsp;</a></span>Cy_CTB_FastInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> Cy_CTB_FastInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__ctb__fast__config__oa0__t.html">cy_stc_ctb_fast_config_oa0_t</a> *&#160;</td>
          <td class="paramname"><em>config0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__ctb__fast__config__oa1__t.html">cy_stc_ctb_fast_config_oa1_t</a> *&#160;</td>
          <td class="paramname"><em>config1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize each opamp of the CTB to one of the common use modes. </p>
<p>This function provides a quick and easy method of configuring the CTB using pre-defined configurations. Only routing switches required for the selected mode are configured, leaving final input and output connections to the user. Additional use modes that relate to the <a class="el" href="group__group__ctdac.html">CTDAC</a> are provided to support easy configuration of the CTDAC output buffer and input reference buffer.</p>
<p>The fast configuration structures define the opamp power, mode, and routing. This function sets the other configuration options of the CTB to:</p><ul>
<li>.deepSleep = CY_CTB_DEEPSLEEP_DISABLE</li>
<li>.oaPump = <a class="el" href="group__group__ctb__enums.html#gga8517634c935bde4de8ccce97aa1e21f4ab9ecbb1c3a529cdeb938ecc3dc6add6f">CY_CTB_PUMP_ENABLE</a></li>
<li>.oaCompEdge = <a class="el" href="group__group__ctb__enums.html#gga6ae45a6e79c46d06120295f542981cf4af356e98625d625f0ed35260a11dc6647">CY_CTB_COMP_EDGE_BOTH</a></li>
<li>.oaCompLevel = <a class="el" href="group__group__ctb__enums.html#gga1d4c88f3c58f2cba9122932a65721f9eaa4b8129109df9d5d1ec3d7253baf7fe2">CY_CTB_COMP_DSI_TRIGGER_OUT_LEVEL</a></li>
<li>.oaCompBypass = <a class="el" href="group__group__ctb__enums.html#ggab99b3f65e01d39c47bb49b1255f478d2a355e7f8cb9d5ba71b9cd5cfa37e293b5">CY_CTB_COMP_BYPASS_SYNC</a></li>
<li>.oaCompHyst = <a class="el" href="group__group__ctb__enums.html#ggad36a97756b1a5ea884c9a6653c0a26c7a5fcfb393b5ff8d864116f914c5147c06">CY_CTB_COMP_HYST_10MV</a></li>
<li>.oaCompIntrEn = true</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This function call disables a whole CTB block, call <a class="el" href="group__group__ctb__functions__init.html#ga867711bf1d5e8216b7bacdf0975fd712">Cy_CTB_Enable</a> after this function call.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">config0</td><td>Pointer to structure containing configuration data for quick initialization of Opamp0. Defined your own or use one of the provided structures:<ul>
<li><a class="el" href="group__group__ctb__globals.html#ga438621c8e34cc926e7b8272a9e19c32e">Cy_CTB_Fast_Opamp0_Unused</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga6d35df56bf042d52cb509a429ffd8c66">Cy_CTB_Fast_Opamp0_Comp</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga4a8e8b6be10950b49f8972996ac93189">Cy_CTB_Fast_Opamp0_Opamp1x</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga545087984306e4fc93d227aea692811a">Cy_CTB_Fast_Opamp0_Opamp10x</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga10000ccb349e4cac132219a53f2d946e">Cy_CTB_Fast_Opamp0_Diffamp</a></li>
<li><a class="el" href="group__group__ctb__globals.html#gad9260078469c446c5f6b2e53b8925392">Cy_CTB_Fast_Opamp0_Vdac_Out</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga0ca19b1b063bd81db94bc7e02edbaa8d">Cy_CTB_Fast_Opamp0_Vdac_Out_SH</a></li>
</ul>
</td></tr>
    <tr><td class="paramname">config1</td><td>Pointer to structure containing configuration data for quick initialization of Opamp1. Defined your own or use one of the provided structures:<ul>
<li><a class="el" href="group__group__ctb__globals.html#gae4a5a3ed003aa16c26c9f0a04beacedb">Cy_CTB_Fast_Opamp1_Unused</a></li>
<li><a class="el" href="group__group__ctb__globals.html#gaf52495cb7b5184752af7aa6d3c0bf1cb">Cy_CTB_Fast_Opamp1_Comp</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga09d24f5970ad021c2dabd7db05041c0e">Cy_CTB_Fast_Opamp1_Opamp1x</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga86d4fa9e4c70a002c5ac83f9b52b4cb6">Cy_CTB_Fast_Opamp1_Opamp10x</a></li>
<li><a class="el" href="group__group__ctb__globals.html#gaf7800cf7550b08e5dc4ec98f158aeee6">Cy_CTB_Fast_Opamp1_Diffamp</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga0ef4edc2f1f65ffd267518c2bb241bdd">Cy_CTB_Fast_Opamp1_Vdac_Ref_Aref</a></li>
<li><a class="el" href="group__group__ctb__globals.html#ga97cd507bb9735d4e2adfd77a17706587">Cy_CTB_Fast_Opamp1_Vdac_Ref_Pin5</a></li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of initialization, <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> or <a class="el" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0da5e724967a6716dc6015415c942370cc5">CY_CTB_BAD_PARAM</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Quickly configure Opamp0 as a comparator and Opamp1 as an opamp with 10x drive.</span></div><div class="line"><span class="comment">     * No routing have been established, leaving final input and output connections to the user. */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Configure and enable the charge pump clock and analog reference currents</span></div><div class="line"><span class="comment">     * before using the CTB. See Configuration Dependencies section in the driver overview for more information. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> status;</div><div class="line">    </div><div class="line">    status = <a class="code" href="group__group__ctb__functions__init.html#ga7bdb789cecd993b6871bc3e31a239473">Cy_CTB_FastInit</a>(CTBM0, &amp;<a class="code" href="group__group__ctb__globals.html#ga6d35df56bf042d52cb509a429ffd8c66">Cy_CTB_Fast_Opamp0_Comp</a>, &amp;<a class="code" href="group__group__ctb__globals.html#ga86d4fa9e4c70a002c5ac83f9b52b4cb6">Cy_CTB_Fast_Opamp1_Opamp10x</a>);</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> == status){</div><div class="line">        <a class="code" href="group__group__ctb__functions__init.html#ga867711bf1d5e8216b7bacdf0975fd712">Cy_CTB_Enable</a>(CTBM0);</div><div class="line">    }</div><div class="line">    </div><div class="line">    <span class="comment">/* Call Cy_CTB_SetAnalogSwitch function to configure routing if desired. */</span></div></div><!-- fragment -->
</div>
</div>
<a id="ga867711bf1d5e8216b7bacdf0975fd712"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga867711bf1d5e8216b7bacdf0975fd712">&#9670;&nbsp;</a></span>Cy_CTB_Enable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTB_Enable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Power up the CTB hardware block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a id="ga3d5c69edc7415f7390036a3a8305f8c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d5c69edc7415f7390036a3a8305f8c2">&#9670;&nbsp;</a></span>Cy_CTB_Disable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTB_Disable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Power down the CTB hardware block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
